<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
    <script src="../js/jquery/jquery-3.3.1.js"></script>
    <script src="../layui/layui.all.js" type="text/javascript" ></script>
</head>

<body>
<script>
function show1(){
    var value=1;
  var w = ($(window).width() * 0.7);
  var h = ($(window).height() - 50);
  var str="";
    layer.open({
        resize: false,
        title: '预览',
        shadeClose: true,
        area: [w + 'px', h + 'px'],
        type: 2,
        content: 'btc.html',
        btn: ['确定', '关闭'],
        yes: function (index, obj) {
            ///当点击‘确定’按钮的时候，获取弹出层返回的值
            var res = window["layui-layer-iframe" + index].show();
            //打印返回的值，看是否有我们想返回的值。
            alert(res);
            //     console.log(res);
            //最后关闭弹出层
            layer.close(index);
        },
        success: function (layero, index) {
            var body = layer.getChildFrame('body', index);
            str = body.find('button').html();
        }
    });
}
function show2(aa){
	alert(aa);
	  
}
</script>
<button type="button"  onClick="show1()">弹出</button>
</body>
</html>
